package cn.luischen.interceptor;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import cn.luischen.constant.Types;
import cn.luischen.constant.WebConst;
import cn.luischen.model.OptionsDomain;
import cn.luischen.model.UserDomain;
import cn.luischen.service.option.OptionService;
import cn.luischen.service.user.UserService;
import cn.luischen.utils.AdminCommons;
import cn.luischen.utils.Commons;
import cn.luischen.utils.IPKit;
import cn.luischen.utils.MapCache;
import cn.luischen.utils.TaleUtils;
import cn.luischen.utils.UUID;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.junit.rules.ExpectedException;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.Map;
import java.util.List;
import com.unitspirit.runtime.*;

/**
 * The class contains tests for the class cn.luischen.interceptor.BaseInterceptor.
 *
 * @generatedBy UnitSpirit CreateTemplateTestFile4
 * @version 1.0.9.11 
 */
@PowerMockIgnore({ "javax.management.*" })
public class BaseInterceptor_afterCompletion_WGTest {
	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	 * 测试方法初始化.
	 * 
	 * @throws Exception 
	 *         if the initialization fails for some reason 
	 *  
	 * @generatedBy UnitSpirit at 2021-11-19 10:54:48
	 */
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	@InjectMocks
	cn.luischen.interceptor.BaseInterceptor unitspirit_fixture;

	@Mock
	cn.luischen.service.user.UserService mock_UserService;
	@Mock
	cn.luischen.utils.AdminCommons mock_AdminCommons;
	@Mock
	cn.luischen.service.option.OptionService mock_OptionService;
	@Mock
	cn.luischen.utils.Commons mock_Commons;

	/**
	 * @date 2021-11-19 10:54:49
	 * @see cn.luischen.interceptor.BaseInterceptor#afterCompletion
	 * @category auto generate by UnitSpirit  
	 * @author null  
	 */
	@Test
	public void test_afterCompletion_20211119_104103_305_1_01()
			throws Throwable {
		//被测函数参数定义
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpServletResponse HttpServletResponse_p_1 = Mockito
				.mock(javax.servlet.http.HttpServletResponse.class);
		Object Object_p_2 = "{\"method\":{\"exceptionTypes\":[],\"parameterTypes\":[\"javax.servlet.http.HttpServletRequest\",\"javax.servlet.http.HttpServletResponse\",\"java.lang.String\",\"java.lang.String\",\"java.lang.String\"],\"name\":\"toLogin\",\"annotations\":[{\"code\":200,\"notes\":\"\",\"hidden\":false,\"authorizations\":[{\"scopes\":[{\"scope\":\"\",\"description\":\"\"}],\"value\":\"\"}],\"httpMethod\":\"\",\"tags\":[\"\"],\"extensions\":[{\"name\":\"\",\"properties\":[{\"name\":\"\",\"value\":\"\"}]}],\"responseHeaders\":[{\"response\":\"java.lang.Void\",\"name\":\"\",\"responseContainer\":\"\",\"description\":\"\"}],\"response\":\"java.lang.Void\",\"nickname\":\"\",\"produces\":\"\",\"responseContainer\":\"\",\"responseReference\":\"\",\"position\":0,\"protocols\":\"\",\"value\":\"閻ц缍�\",\"consumes\":\"\"},{\"headers\":[],\"path\":[],\"name\":\"\",\"produces\":[],\"params\":[],\"value\":[\"/login\"],\"consumes\":[]},{}],\"parameterAnnotations\":[[],[],[{\"access\":\"\",\"allowableValues\":\"\",\"allowMultiple\":false,\"hidden\":false,\"defaultValue\":\"\",\"name\":\"username\",\"value\":\"閻€劍鍩涢崥锟�\",\"required\":true},{\"defaultValue\":\"\n\t\t\n\t\t\n椤庯拷椤庝緡锟戒繐n\t\t\t\t\n\",\"name\":\"username\",\"value\":\"\",\"required\":true}],[{\"access\":\"\",\"allowableValues\":\"\",\"allowMultiple\":false,\"hidden\":false,\"defaultValue\":\"\",\"name\":\"password\",\"value\":\"鐎靛棛鐖�\",\"required\":true},{\"defaultValue\":\"\n\t\t\n\t\t\n椤庯拷椤庝緡锟戒繐n\t\t\t\t\n\",\"name\":\"password\",\"value\":\"\",\"required\":true}],[{\"access\":\"\",\"allowableValues\":\"\",\"allowMultiple\":false,\"hidden\":false,\"defaultValue\":\"\",\"name\":\"remeber_me\",\"value\":\"鐠侀缍囬幋锟�\",\"required\":false},{\"defaultValue\":\"\n\t\t\n\t\t\n椤庯拷椤庝緡锟戒繐n\t\t\t\t\n\",\"name\":\"remeber_me\",\"value\":\"\",\"required\":false}]],\"modifiers\":1,\"returnType\":\"cn.luischen.utils.APIResponse\"},\"bean\":{},\"beanType\":\"cn.luischen.controller.admin.AuthController\",\"resolvedFromHandlerMethod\":{\"method\":{\"$ref\":\"$.method\"},\"bean\":\"authController\",\"beanType\":\"cn.luischen.controller.admin.AuthController\"}}";
		Exception Exception_p_3 = null;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		unitspirit_fixture.afterCompletion(HttpServletRequest_p_0,
				HttpServletResponse_p_1, Object_p_2, Exception_p_3);
		assertTrue(true);
	}

	/**
	 * @date 2021-11-19 10:54:49
	 * @see cn.luischen.interceptor.BaseInterceptor#afterCompletion
	 * @category auto generate by UnitSpirit  
	 * @author null  
	 */
	@Test
	public void test_afterCompletion_20211119_104607_719_1_01()
			throws Throwable {
		//被测函数参数定义
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpServletResponse HttpServletResponse_p_1 = Mockito
				.mock(javax.servlet.http.HttpServletResponse.class);
		Object Object_p_2 = "{\"method\":{\"exceptionTypes\":[],\"parameterTypes\":[\"javax.servlet.http.HttpServletRequest\",\"javax.servlet.http.HttpServletResponse\",\"java.lang.String\",\"java.lang.String\",\"java.lang.String\"],\"name\":\"toLogin\",\"annotations\":[{\"code\":200,\"notes\":\"\",\"hidden\":false,\"authorizations\":[{\"scopes\":[{\"scope\":\"\",\"description\":\"\"}],\"value\":\"\"}],\"httpMethod\":\"\",\"tags\":[\"\"],\"extensions\":[{\"name\":\"\",\"properties\":[{\"name\":\"\",\"value\":\"\"}]}],\"responseHeaders\":[{\"response\":\"java.lang.Void\",\"name\":\"\",\"responseContainer\":\"\",\"description\":\"\"}],\"response\":\"java.lang.Void\",\"nickname\":\"\",\"produces\":\"\",\"responseContainer\":\"\",\"responseReference\":\"\",\"position\":0,\"protocols\":\"\",\"value\":\"闁谎嗩嚙缂嶏拷\",\"consumes\":\"\"},{\"headers\":[],\"path\":[],\"name\":\"\",\"produces\":[],\"params\":[],\"value\":[\"/login\"],\"consumes\":[]},{}],\"parameterAnnotations\":[[],[],[{\"access\":\"\",\"allowableValues\":\"\",\"allowMultiple\":false,\"hidden\":false,\"defaultValue\":\"\",\"name\":\"username\",\"value\":\"闁烩偓鍔嶉崺娑㈠触閿燂拷\",\"required\":true},{\"defaultValue\":\"\n\t\t\n\t\t\n妞ゅ函鎷锋い搴濈贰閿熸垝绻恘\t\t\t\t\n\",\"name\":\"username\",\"value\":\"\",\"required\":true}],[{\"access\":\"\",\"allowableValues\":\"\",\"allowMultiple\":false,\"hidden\":false,\"defaultValue\":\"\",\"name\":\"password\",\"value\":\"閻庨潧妫涢悥锟�\",\"required\":true},{\"defaultValue\":\"\n\t\t\n\t\t\n妞ゅ函鎷锋い搴濈贰閿熸垝绻恘\t\t\t\t\n\",\"name\":\"password\",\"value\":\"\",\"required\":true}],[{\"access\":\"\",\"allowableValues\":\"\",\"allowMultiple\":false,\"hidden\":false,\"defaultValue\":\"\",\"name\":\"remeber_me\",\"value\":\"閻犱線顣︾紞鍥箣閿燂拷\",\"required\":false},{\"defaultValue\":\"\n\t\t\n\t\t\n妞ゅ函鎷锋い搴濈贰閿熸垝绻恘\t\t\t\t\n\",\"name\":\"remeber_me\",\"value\":\"\",\"required\":false}]],\"modifiers\":1,\"returnType\":\"cn.luischen.utils.APIResponse\"},\"bean\":{},\"beanType\":\"cn.luischen.controller.admin.AuthController\",\"resolvedFromHandlerMethod\":{\"method\":{\"$ref\":\"$.method\"},\"bean\":\"authController\",\"beanType\":\"cn.luischen.controller.admin.AuthController\"}}";
		Exception Exception_p_3 = null;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		unitspirit_fixture.afterCompletion(HttpServletRequest_p_0,
				HttpServletResponse_p_1, Object_p_2, Exception_p_3);
		assertTrue(true);
	}
}
